<!DOCTYPE html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<title>学会人员资料</title>
	<link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../css/common.css" />
		<link rel="stylesheet" type="text/css" href="../../css/aui.css" />

    <style>
    	html, body {width: 100%;min-height: 100%;background: #f0f0f0;}

		#header_top {
			padding-top: 25px;
			background: #2997e4;
		}
		.rz img {
			width: 40%;
			display: block;
			margin: 5rem auto 1rem;
		}
		.rz h4 {
			color: #333;
			text-align: center;
			font-size: 0.8rem;
		}
		.save_but {
      background-color: #2997e4;
      font-size: 0.8rem;
      color: #fff;
      padding: 0.5rem 0;
      margin: 2rem 0.75rem 0;
      text-align: center;
      border-radius: 4px;
    }
    </style>
</head>
<body>
  <header id="header_top" class="aui-bar aui-bar-nav" >

    <a class="aui-pull-left"  onclick="goback()">
        <span class="aui-iconfont aui-icon-left"></span>
    </a>
    <div class="aui-title" id="title">
    医生认证
  </div>
  </header>
<div id="app" v-cloak>
	<div class="rz rzsb" v-if="status == 1">
		<img src="../../image/firstpage/rzsb@3x.png" alt="">
		<h4>认证失败，请认真核实您的资料</h4>
	  <div class="save_but" @click="openQRZ()">
	    去认证
	  </div>
	</div>

	<div class="rz shz" v-else-if="status == 2">
		<img src="../../image/firstpage/rzz@3x.png" alt="">
		<h4>认证审核中，请耐心等待</h4>
	</div>

	<div class="rz wrz" v-else-if="status == 3">
		<img src="../../image/firstpage/wrz@3x.png" alt="">
		<h4>您还没有经过医生认证</h4>
		<div class="save_but" @click="openQRZ()">
			去认证
		</div>
	</div>

	<div class="rz tgrz" v-else-if="status == 0">
		<img src="../../image/firstpage/yrz@3x.png" alt="">
		<h4>您已通过医生认证</h4>
	</div>



</div>
	<div class="h10"></div><div class="h10"></div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/vue.min.js"></script>
<script type="text/javascript" src="../../script/utils.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript">

	function goback () {
		api.closeWin({name:api.pageParam.name});
	}

	apiready = function() {

	var app = new Vue({
		el: '#app',
		data: {
			token: 0,
			status: 0
		},
		created: function() {
			var $_this = this;
			$_this.token = $api.getStorage('token');
			if(!$api.getStorage('token')){
        api.confirm( {
            title: '是否登录',
            msg: '确认是否登录？',
            buttons: [ '确定', '取消' ]
          }, function ( ret, err ) {
            var index = ret.buttonIndex;
            if ( index == 1 ) {
              api.openWin({
                name: 'login',
                url: '../five_frame/login_header.html',
                delay: 200,
                bounces: false
              });
              return;
            } else {
              api.closeWin({
                  name: name
              });
              return
            }
          })
          return
        }
			api.ajax({
				url: window.Url.isDoctor,
				timeout: 300,
				headers: {
				  'baseParams': $_this.token //token
				},
			}, function(ret, err) {
					if (ret) {
						if (ret.code == 2) {
                  alert('用户未登录，请返回登录')
                  $api.rmStorage('token')
                  $api.rmStorage('data')
                  goback()
                   return
                }
							// api.alert({ msg: JSON.stringify(ret) });
							$_this.status = ret.data.audit_statu
					} else {
							api.alert({ msg: JSON.stringify(err) });
					}
			})
		},
		methods: {
			openQRZ: function () {
				api.openWin({
					name: 'index_jk_qrz',
					pageParam: {
						name: 'index_jk_qrz'
					},
					url: './index_jk_qrz.html',
					delay: 200,
					bounces: false
				});
			}
		}
	})
}




</script>
</html>
